Attribute VB_Name = "Module1"
Option Explicit

Public Declare Function DwmDefWindowProc Lib "dwmapi.dll" (ByVal hwnd As Long, ByVal uMsg As Long, ByVal wParam As Long, ByVal lParam As Long, LRESULT As Long) As Long

Public Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Public Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Public Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Public Declare Function DefWindowProc Lib "user32" Alias "DefWindowProcA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Public Declare Function DwmExtendFrameIntoClientArea Lib "dwmapi.dll" (ByVal hwnd As Long, pMarInset As MARGINS) As Long

Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (pDest As Any, pSrc As Any, ByVal ByteLen As Long)

Public Type MARGINS
  m_Left As Long
  m_Right As Long
  m_Top As Long
  m_Bottom As Long
End Type

Type POINTAPI
        x As Long
        y As Long
End Type

Public Const GWL_WNDPROC = (-4)
Public Const WM_NCCALCSIZE = &H83
Public Const WM_NCHITTEST = &H84
Public Const SWP_FRAMECHANGED = &H20
Public Type RECT
        Left As Long
        Top As Long
        Right As Long
        Bottom As Long
End Type
Public Type WINDOWPOS
        hwnd As Long
        cy As Long
        flags As Long
        y As Long
        cx As Long
        x As Long
        hWndInsertAfter As Long
End Type

Public Type NCCALCSIZE_PARAMS
RECT(3) As RECT
lppos As Long 'lp of a WINDOWPOS
End Type

Public pNCP As NCCALCSIZE_PARAMS
Public rcClient As RECT
Public boolDWMDEF As Long
Public LRESULT As Long

Private Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" (ByVal lpPrevWndFunc As Long, ByVal hwnd As Long, ByVal uMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Public lpPrevWP As Long

Public Function myWP(ByVal hwnd As Long, ByVal uMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long

If uMsg = WM_NCCALCSIZE And wParam > 0 Then
myWP = 0
Else


boolDWMDEF = DwmDefWindowProc(hwnd, uMsg, wParam, lParam, LRESULT)
If boolDWMDEF = 1 Then
         myWP = LRESULT
Else
myWP = CallWindowProc(lpPrevWP, hwnd, uMsg, wParam, lParam)
End If

End If

End Function

Private Function HitTestNCA(ByVal hwnd As Long, ByVal uMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Dim ptMouse As POINTAPI
End Function
